<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"></meta>
<title>Esempio di dichiarazione e utilizzo di Array e JavaScript
	Object</title>

</head>
<body>
	Codice:
	<pre>
		function MyFirstClass(name) {
			this.name = name;
		}
		
		MyFirstClass.prototype.aMethod = function() {
			alert('a method called');
		};
		
		MyFirstClass.prototype.getName = function() {
			return this.name;
		};
		
		var myObject = new MyFirstClass('Goofy');
		alert(myObject.getName());
	</pre>

	<script>
		function MyFirstClass(name) {
			this.name = name;
		}
		
		MyFirstClass.prototype.aMethod = function() {
			alert('a method called');
		};
		
		MyFirstClass.prototype.getName = function() {
			return this.name;
		};
		
		var myObject = new MyFirstClass('Goofy');
		alert(myObject.getName());
	</script>

</body>
</html>
